<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">

      <el-form-item  prop="construction">
        <el-select v-model="queryParams.construction" placeholder="请选择建设场所" clearable>
          <el-option
            v-for="dict in dict.type.station_construction"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>

      <el-form-item  prop="stationType">
        <el-select v-model="queryParams.stationType" placeholder="请选择站点类型" clearable>
          <el-option
            v-for="dict in dict.type.station_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>

      <el-form-item  prop="stationStatus">
        <el-select v-model="queryParams.stationStatus" placeholder="请选择站点状态" clearable>
          <el-option
            v-for="dict in dict.type.station_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>

      <el-form-item  prop="stationName">
        <el-input
          v-model="queryParams.stationName"
          placeholder="请输入充电桩名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

       <el-form-item  prop="stationTel">
        <el-input
          v-model="queryParams.stationTel"
          placeholder="请输入站点电话"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item  prop="serviceTel">
        <el-input
          v-model="queryParams.serviceTel"
          placeholder="请输入服务电话"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>


      <!-- 根据isContentVisible的状态来决定是否渲染内容 -->
      <template v-if="isSearchContentVisible">

          <el-form-item  prop="countryCode">
          <el-input
            v-model="queryParams.countryCode"
            placeholder="请输入充电站国家代码"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>

        <el-form-item  prop="equipmentOwnerId">
          <el-input
            v-model="queryParams.equipmentOwnerId"
            placeholder="请输入设备所属方id"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>

        <el-form-item  prop="areaCode">
          <el-input
            v-model="queryParams.areaCode"
            placeholder="请输入充电站省市辖区编码"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>

          <el-form-item  prop="address">
            <el-input
              v-model="queryParams.address"
              placeholder="请输入详细地址"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          
         

          <el-form-item  prop="parkNums">
            <el-input
              v-model="queryParams.parkNums"
              placeholder="请输入车位数量"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          <el-form-item  prop="stationLng">
            <el-input
              v-model="queryParams.stationLng"
              placeholder="请输入经度"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          <el-form-item  prop="stationLat">
            <el-input
              v-model="queryParams.stationLat"
              placeholder="请输入纬度"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          <el-form-item  prop="siteGuide">
            <el-input
              v-model="queryParams.siteGuide"
              placeholder="请输入站点引导"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          

          <el-form-item  prop="matchCars">
            <el-input
              v-model="queryParams.matchCars"
              placeholder="请输入使用车型描述"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          <el-form-item  prop="parkInfo">
            <el-input
              v-model="queryParams.parkInfo"
              placeholder="请输入车位楼层及数量描述"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          <el-form-item  prop="busineHours">
            <el-input
              v-model="queryParams.busineHours"
              placeholder="请输入营业时间"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          <el-form-item  prop="electricityFee">
            <el-input
              v-model="queryParams.electricityFee"
              placeholder="请输入充电电费率(充电费描述)"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          <el-form-item  prop="serviceFee">
            <el-input
              v-model="queryParams.serviceFee"
              placeholder="请输入服务费率(服务费率描述)"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          <el-form-item  prop="parkFee">
            <el-input
              v-model="queryParams.parkFee"
              placeholder="请输入停车费(停车费率描述)"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          <el-form-item  prop="payment">
            <el-input
              v-model="queryParams.payment"
              placeholder="请输入支付方式"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>

          <el-form-item  prop="supportOrder">
            <el-select v-model="queryParams.supportOrder" placeholder="请选择是否支持预约" clearable>
              <el-option
                v-for="dict in dict.type.station_support_order"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>

          <el-form-item  prop="syncTime">
            <el-date-picker clearable
              v-model="queryParams.syncTime"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="请选择数据同步时间">
            </el-date-picker>
          </el-form-item>
      </template>

      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
         <!-- 展开按钮 -->
        <el-button icon="el-icon-arrow-down" @click.stop="toggleSearchContent(true)" size="mini" v-if="!isSearchContentVisible">更多</el-button>
        <!-- 收起按钮 -->
        <el-button icon="el-icon-arrow-up" @click.stop="toggleSearchContent(false)" size="mini" v-if="isSearchContentVisible">收起</el-button>

      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">

      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-refresh-right"
          size="mini"
          @click="handleSyncStationData"
          v-hasPermi="['bus:busStation:edit']"
        >同步</el-button>
      </el-col>

      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['bus:busStation:add']"
        >新增</el-button>
      </el-col>

      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['bus:busStation:remove']"
        >删除</el-button>
      </el-col>

      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['bus:busStation:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="busStationList" @selection-change="handleSelectionChange" border>
      <el-table-column type="selection" width="55" align="center" fixed />
      <el-table-column label="充电站名称" align="center" prop="stationName" width="150" show-overflow-tooltip fixed />
      <el-table-column label="站点类型" align="center" prop="stationType" width="100" show-overflow-tooltip>
        <template slot-scope="scope">
          <dict-tag :options="dict.type.station_type" :value="scope.row.stationType"/>
        </template>
      </el-table-column>
      <el-table-column label="站点状态" align="center" prop="stationStatus" width="100" show-overflow-tooltip>
        <template slot-scope="scope">
          <dict-tag :options="dict.type.station_status" :value="scope.row.stationStatus"/>
        </template>
      </el-table-column>
      <el-table-column label="车位数量" align="center" prop="parkNums" width="100" show-overflow-tooltip />
      <el-table-column label="是否支持预约" align="center" prop="supportOrder" width="100" show-overflow-tooltip>
        <template slot-scope="scope">
          <dict-tag :options="dict.type.station_support_order" :value="scope.row.supportOrder"/>
        </template>
      </el-table-column>
      <el-table-column label="建设场所" align="center" prop="construction" width="100" show-overflow-tooltip>
        <template slot-scope="scope">
          <dict-tag :options="dict.type.station_construction" :value="scope.row.construction"/>
        </template>
      </el-table-column>
      <el-table-column label="站点照片" align="center" prop="pictures" sortable="custom" width="120">
        <template slot-scope="scope">
          <image-preview :src="scope.row.pictures" :width="30" :height="30"/>
        </template>
      </el-table-column>
      <el-table-column label="充电站ID" align="center" prop="stationId" width="150" show-overflow-tooltip />
      <el-table-column label="运营商ID" align="center" prop="operatorId" width="150" show-overflow-tooltip />
      <el-table-column label="设备所属方ID" align="center" prop="equipmentOwnerId" width="150" show-overflow-tooltip />
      <el-table-column label="充电站国家代码" align="center" prop="countryCode" width="150" show-overflow-tooltip />
      <el-table-column label="充电站省市辖区编码" align="center" prop="areaCode" width="150" show-overflow-tooltip />
      <el-table-column label="详细地址" align="center" prop="address" width="150" show-overflow-tooltip />
      <el-table-column label="站点电话" align="center" prop="stationTel" width="150" show-overflow-tooltip />
      <el-table-column label="服务电话" align="center" prop="serviceTel" width="150" show-overflow-tooltip />
      <el-table-column label="经度" align="center" prop="stationLng" width="100" show-overflow-tooltip />
      <el-table-column label="纬度" align="center" prop="stationLat" width="100" show-overflow-tooltip />
      <el-table-column label="站点引导" align="center" prop="siteGuide" width="150" show-overflow-tooltip />
      <el-table-column label="使用车型描述" align="center" prop="matchCars" width="150" show-overflow-tooltip />
      <el-table-column label="车位楼层及数量描述" align="center" prop="parkInfo" width="150" show-overflow-tooltip />
      <el-table-column label="营业时间" align="center" prop="busineHours" width="150" show-overflow-tooltip />
      <el-table-column label="充电电费率" align="center" prop="electricityFee" width="150" show-overflow-tooltip />
      <el-table-column label="服务费率" align="center" prop="serviceFee" width="150" show-overflow-tooltip />
      <el-table-column label="停车费" align="center" prop="parkFee" width="150" show-overflow-tooltip />
      <el-table-column label="支付方式" align="center" prop="payment" width="150" show-overflow-tooltip />
      <el-table-column label="备注" align="center" prop="remark" width="150" show-overflow-tooltip />
      <el-table-column label="数据同步时间" align="center" prop="syncTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.syncTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" fixed="right" width="180" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['bus:busStation:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['bus:busStation:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改充电站对话框 -->
  <el-drawer :title="title" :visible.sync="open" size="60%" append-to-body direction="rtl">

      <el-card style="margin: 20px 20px 70px 20px;">
        <el-form ref="form" :model="form" :rules="rules" label-width="30%">
          <el-row>
            <el-col :span="12">
              <el-form-item label="设备所属方id" prop="equipmentOwnerId">
                <el-input v-model="form.equipmentOwnerId" placeholder="请输入设备所属方id" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="充电桩名称" prop="stationName">
                <el-input v-model="form.stationName" placeholder="请输入充电桩名称" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="充电站国家代码" prop="countryCode">
                <el-input v-model="form.countryCode" placeholder="请输入充电站国家代码" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="充电站省市辖区编码" prop="areaCode">
                <el-input v-model="form.areaCode" placeholder="请输入充电站省市辖区编码" />
              </el-form-item>
            </el-col>
            
            <el-col :span="12">
              <el-form-item label="详细地址" prop="address">
                <el-input v-model="form.address" placeholder="请输入详细地址" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="站点电话" prop="stationTel">
                <el-input v-model="form.stationTel" placeholder="请输入站点电话" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="服务电话" prop="serviceTel">
                <el-input v-model="form.serviceTel" placeholder="请输入服务电话" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="站点类型" prop="stationType">
                <el-select v-model="form.stationType" style="width:100%" placeholder="请选择站点类型">
                  <el-option
                    v-for="dict in dict.type.station_type"
                    :key="dict.value"
                    :label="dict.label"
                    :value="parseInt(dict.value)"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="站点状态" prop="stationStatus">
                <el-select v-model="form.stationStatus" style="width:100%" placeholder="请选择站点状态">
                  <el-option
                    v-for="dict in dict.type.station_status"
                    :key="dict.value"
                    :label="dict.label"
                    :value="parseInt(dict.value)"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="车位数量" prop="parkNums">
                <el-input v-model="form.parkNums" placeholder="请输入车位数量" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="经度" prop="stationLng">
                <el-input v-model="form.stationLng" placeholder="请输入经度" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="纬度" prop="stationLat">
                <el-input v-model="form.stationLat" placeholder="请输入纬度" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="站点引导" prop="siteGuide">
                <el-input v-model="form.siteGuide" placeholder="请输入站点引导(描述性文字，用于引导车主找 到充电车位)" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="建设场所" prop="construction">
                <el-select v-model="form.construction" style="width:100%" placeholder="请选择建设场所">
                  <el-option
                    v-for="dict in dict.type.station_construction"
                    :key="dict.value"
                    :label="dict.label"
                    :value="parseInt(dict.value)"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="站点照片" prop="pictures">
                <el-input v-model="form.pictures" type="text" placeholder="请输入内容" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
                <el-form-item label="使用车型描述" prop="matchCars">
                  <el-input v-model="form.matchCars" placeholder="请输入使用车型描述" />
                </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="车位楼层及数量描述" prop="parkInfo">
                <el-input v-model="form.parkInfo" placeholder="请输入车位楼层及数量描述" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="营业时间" prop="busineHours">
                <el-input v-model="form.busineHours" placeholder="请输入营业时间" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="充电电费率" prop="electricityFee">
                <el-input v-model="form.electricityFee" placeholder="请输入充电电费率(充电费描述)" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="服务费率" prop="serviceFee">
                <el-input v-model="form.serviceFee" placeholder="请输入服务费率(服务费率描述)" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="停车费" prop="parkFee">
                <el-input v-model="form.parkFee" placeholder="请输入停车费(停车费率描述)" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="支付方式" prop="payment">
                <el-input v-model="form.payment" placeholder="请输入支付方式" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="是否支持预约" prop="supportOrder">
                <el-select v-model="form.supportOrder" placeholder="请选择是否支持预约" style="width:100%">
                  <el-option
                    v-for="dict in dict.type.station_support_order"
                    :key="dict.value"
                    :label="dict.label"
                    :value="parseInt(dict.value)"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="备注" prop="remark">
                <el-input v-model="form.remark" placeholder="请输入备注" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
                <el-form-item label="数据同步时间" prop="syncTime">
                  <el-date-picker 
                    style="width:100%"
                    clearable
                    v-model="form.syncTime"
                    type="date"
                    value-format="yyyy-MM-dd"
                    placeholder="请选择数据同步时间">
                  </el-date-picker>
                </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </el-card>

      <div class="demo-drawer__footer">
        <el-button type="primary" icon="el-icon-circle-check" @click="submitForm">确 定</el-button>
        <el-button icon="el-icon-close" @click="cancel" >取 消</el-button>
      </div>
    </el-drawer>
  </div>
</template>

<script>
import { listBusStation, getBusStation, delBusStation, addBusStation, updateBusStation,syncStationData } from "@/api/bus/busStation";

export default {
  name: "BusStation",
  dicts: ['station_status', 'station_type', 'station_support_order', 'station_construction'],
  data() {
    return {
      // 是否显示更多搜索条件
      isSearchContentVisible: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 充电站表格数据
      busStationList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        equipmentOwnerId: null,
        stationName: null,
        countryCode: null,
        areaCode: null,
        address: null,
        stationTel: null,
        serviceTel: null,
        stationType: null,
        stationStatus: null,
        parkNums: null,
        stationLng: null,
        stationLat: null,
        siteGuide: null,
        construction: null,
        pictures: null,
        matchCars: null,
        parkInfo: null,
        busineHours: null,
        electricityFee: null,
        serviceFee: null,
        parkFee: null,
        payment: null,
        supportOrder: null,
        syncTime: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        equipmentOwnerId: [
          { required: true, message: "设备所属方id不能为空", trigger: "blur" }
        ],
        stationName: [
          { required: true, message: "充电桩名称不能为空", trigger: "blur" }
        ],
        countryCode: [
          { required: true, message: "充电站国家代码不能为空", trigger: "blur" }
        ],
        areaCode: [
          { required: true, message: "充电站省市辖区编码不能为空", trigger: "blur" }
        ],
        address: [
          { required: true, message: "详细地址不能为空", trigger: "blur" }
        ],
        serviceTel: [
          { required: true, message: "服务电话不能为空", trigger: "blur" }
        ],
        stationType: [
          { required: true, message: "站点类型不能为空", trigger: "change" }
        ],
        stationStatus: [
          { required: true, message: "站点状态不能为空", trigger: "change" }
        ],
        parkNums: [
          { required: true, message: "车位数量不能为空", trigger: "blur" }
        ],
        stationLng: [
          { required: true, message: "经度不能为空", trigger: "blur" }
        ],
        stationLat: [
          { required: true, message: "纬度不能为空", trigger: "blur" }
        ],
        construction: [
          { required: true, message: "建设场所不能为空", trigger: "change" }
        ],
        syncTime: [
          { required: true, message: "数据同步时间不能为空", trigger: "blur" }
        ]
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    // 切换内容的显示状态
    toggleSearchContent(show) {
      this.isSearchContentVisible = show
    },
    /** 查询充电站列表 */
    getList() {
      this.loading = true;
      listBusStation(this.queryParams).then(response => {
        this.busStationList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        stationId: null,
        operatorId: null,
        equipmentOwnerId: null,
        stationName: null,
        countryCode: null,
        areaCode: null,
        address: null,
        stationTel: null,
        serviceTel: null,
        stationType: null,
        stationStatus: null,
        parkNums: null,
        stationLng: null,
        stationLat: null,
        siteGuide: null,
        construction: null,
        pictures: null,
        matchCars: null,
        parkInfo: null,
        busineHours: null,
        electricityFee: null,
        serviceFee: null,
        parkFee: null,
        payment: null,
        supportOrder: null,
        remark: null,
        syncTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.stationId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加充电站";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const stationId = row.stationId || this.ids
      getBusStation(stationId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改充电站";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.stationId != null) {
            updateBusStation(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addBusStation(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const stationIds = row.stationId || this.ids;
      this.$modal.confirm('是否确认删除充电站编号为"' + stationIds + '"的数据项？').then(function() {
        return delBusStation(stationIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    handleSyncStationData(){
      this.$modal.confirm("确认同步数据？").then(function() {
        return syncStationData();
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("同步成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('bus/busStation/export', {
        ...this.queryParams
      }, `busStation_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>



<style>
  .demo-drawer__footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 0 12px 0 20px;
    background-color: #fff;
    border-top: 1px solid #d9d9d9;
    height: 60px;
    line-height: 60px;
    z-index: 999999;
  }


  .el-dropdown-menu__item {
    font-size: 12px;
    color: #1890ff;
  }
</style>